package server;

import gui.engraving.EngravingFrame;
import gui.engraving.EngravingPanel;

import java.awt.Toolkit;
import java.util.ArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;

import javax.swing.JFrame;
import javax.swing.SwingUtilities;

import clients.RPCClient;

/**
 * @author Idan
 * Server GUI Frame
 */
public class ServerFrame extends JFrame
{

	private ServerPanel serverPanel;
    

    public ServerFrame()
    {
    	setIconImage(Toolkit.getDefaultToolkit().getImage(ServerFrame.class.getResource("/graphics/Spearhead.png")));
    	setTitle("ח.נ.י.ת");
        initComponents();
    }

   
    @SuppressWarnings("unchecked")
  
    private void initComponents()
    {

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 559, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 481, Short.MAX_VALUE)
        );

        pack();
    }
    
    public static void main(String args[])
    {
        
       
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(ServerFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(ServerFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(ServerFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(ServerFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        
        /* Create client and connect to the Server*/

        
            
            
        
        /* Create and display the form */
            SwingUtilities.invokeLater(new Runnable()
        {
            public void run() 
            {
            	
                
            	ServerFrame serverFrame = new ServerFrame();
            	serverFrame.serverPanel = new ServerPanel(); 
            	serverFrame.setContentPane(serverFrame.serverPanel);
                
                // call functions
             

            
        	
            	serverFrame.serverPanel.setVariables();
            	//serverFrame.serverPanel.runServer();
            	serverFrame.setVisible(true);  
            	
           
            	
            }
        });
            
         
            

           
    }

   

    
}
